home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Welcome to tgif, the Two-toned GIF utility!
-
-
- Tgif is a utility program to display color graphic images on a plasma,
- LCD or monochrome graphics display. The input format is the Compuserve
- GIF format for color images. Tgif unpacks these GIF files and performs
- a halftone process on the image so that the various colors of the
- palette are displayed using patterns of black and white pixels that
- approximate the intensities of each color. This is the same process
- that allows images to be printed in black and white media such as books
- and newspapers. The algorithm used to perform the halftone
- transformation is an error distribution process developed by R. W.
- Floyd and L. Steinburg.
-
- Tgif starts by computing the intensity of each palette color by summing
- the values of the red, green and blue intensities supplied in the GIF
- image. A threshold intensity level is computed to represent the average
- intensity of all colors in the palette. This threshold value is used to
- make the decision as to whether a displayed pixel is black (pixel <=
- threshold) or white (pixel > threshold). Unless the pixel displayed is
- exactly black or white, an intensity error is incurred. This error
- represents the difference between the pixel's intensity and what was
- actually displayed. When distributed among the neighboring pixels, this
- error influences the threshold decision for those pixels and changes
- their display values thus creating a distribution of black and white
- pixels that approximates the color intensity.
-
- The above algorithm not only produces excellent visual results, it also
- provides a remarkable and unexpected feature when the image is enlarged.
- Tgif provides option switches to enlarge the image beyond the size
- supplied by the GIF file. What this actually does is increase the
- number of pixels in the drawing. In the instance of a double size
- image, when a single pixel is unpacked from the GIF file tgif creates
- four pixels of the same color; a block of four pixels where there was
- just one. The result is the same image but with pixels twice the
- original size. When this "big bit" image is halftoned by tgif, the "big
- bits" are resolved into an image that actually has more detail than the
- smaller version of the same image. In other words, the big pictures
- look better, have more detail and look just as smooth as the smaller
- images. Images can be enlarged to triple size with the same results.
- Only when enlarged to quadruple size did the resulting image start to
- get blocky and degraded, although this might be cured by increasing the
- fractional part of the error accumulators used in the algorithm.
-
- Tgif was developed to run using Toshiba plasma type display screens with
- 640 by 400 resolution (T3100, T3200, T5100). If no command line option
- is used, tgif will attempt to set the video mode to the special mode
- 0x74 used by Toshiba plasma screens. A command line option forces tgif
- to use any CGA type adapter and another option will force inverse video
- for CGA compatible LCD displays. The CGA mode used by tgif is the 640
- by 200 two color mode (mode 6). Since the aspect ratio of the pixels in
- this mode is not 1:1 (that is, CGA pixels are taller than they are wide)
- it is recommended that the command line option to widen the image be
- used.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The usage of tgif is as follows:
-
-
- Usage: tgif {/w} {/l} {/d} {/t} {/r} {/c} giffile{.ext}
-
- Options: /w == widen image
- /l == lengthen image
- /d == double size
- /t == triple size
- /r == reverse video (for LCD screens)
- /c == force CGA mode
-
- Example: tgif/d/r picture
- Would open picture.GIF and display a double size
- image in reverse video.
-
- Notes:
-
- Command line options are stacked onto the program name and
- separated by slashes.
-
- If a filename extension is not included, ".GIF" is assumed.
-
-
- Once invoked, tgif starts unpacking and halftoning the GIF image. If the
- image is supplied in interlace mode, tgif uses two passes; one to unpack
- and de-interlace the raster lines and a second to halftone the pixels.
- For non-interlaced images, one pass performs both operations. As the
- color image is halftoned, the black and white raster data is stored into
- memory until the entire image has been completed. Tgif provides status
- displays about the GIF file as it is being processed.
-
- Once completed, tgif shifts into an image display mode where the user
- may view the image. If the completed image is larger than the selected
- display size, the arrow keys may be used move the display window to any
- part of the image. The active keys are:
-
- key usage
-
- up-arrow move window up
- down-arrow move window down
- left-arrow move window left
- right-arrow move window right
- page-up big move up
- page-down big move down
- home display top of image
- end display bottom of image
- escape exit tgif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The source code module tgif.c has been provided for a number of reasons.
- Hopefully it will help others avoid some of the pitfalls encountered
- while unpacking and displaying GIF file images. The included tgif.exe
- file was compiled directly from the included tgif.c source module using
- MIX software's Power C compiler. This and many other "c" projects have
- convinced me that this compiler is one of the greatest values in the
- world of computing.
-
- You will also notice that the source code statements in tgif.c are
- uncommented. Since this is a shareware product, you are requested to
- support this effort with a $10 shareware fee. Fully commented listings
- as well as future enhancements will be available to registered users of
- tgif. One enhancement that is foreseeable is the conversion of certain
- procedures into assembly language to increase the speed of tgif's
- processing.
-
- The reporting of any bugs, anomalies or GIF files that tgif cannot
- display would also be appreciated.
-
- To all novice or beginning users, tgif is offered for your entertainment
- and possibly educational uses. To all of you experts I offer a friendly
- challenge: now that you have the source code, make tgif better in some
- way and let me know how you did it.
-
- This code was written and will be supported by:
-
- James Lark
- 6101 W. Courtyard Dr.
- Austin, TX. 78730
-
-